import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [

    {
        path: '/homepage',
        name: 'homepage',
        component: () =>
            import ('../views/homepage.vue'),
        children: [{
                path: '/selected',
                name: 'selected',
                component: () =>
                    import ('../views/homepage/selected.vue')
            },
            {
                path: '/skin',
                name: 'skin',
                component: () =>
                    import ('../views/homepage/skin.vue')

            },
            {
                path: '/cosmetics',
                name: 'cosmetics',
                component: () =>
                    import ('../views/homepage/cosmetics.vue')
            },

            {
                path: '/perfume',
                name: 'perfume',
                component: () =>
                    import ('../views/homepage/perfume.vue')
            },

            {
                path: '/ minority',
                name: ' minority',
                component: () =>
                    import ('../views/homepage/minority.vue')
            },
            {
                path: '/man',
                name: 'man',
                component: () =>
                    import ('../views/homepage/man.vue')
            },
            {
                path: '/care',
                name: 'care',
                component: () =>
                    import ('../views/homepage/care.vue')
            },
        ]

    },
    {
        path: '/classify',
        name: 'classify',
        component: () =>
            import ('../views/classify.vue'),
        children: [{
                path: '/a',
                name: 'a',
                component: () =>
                    import ('../views/classify/a.vue')
            },
            {
                path: '/b',
                name: 'b',
                component: () =>
                    import ('../views/classify/b.vue')
            }, {
                path: '/c',
                name: 'c',
                component: () =>
                    import ('../views/classify/c.vue')
            }, {
                path: '/d',
                name: 'd',
                component: () =>
                    import ('../views/classify/d.vue')
            }, {
                path: '/e',
                name: 'e',
                component: () =>
                    import ('../views/classify/e.vue')
            }, {
                path: '/f',
                name: 'f',
                component: () =>
                    import ('../views/classify/f.vue')
            }, {
                path: '/g',
                name: 'g',
                component: () =>
                    import ('../views/classify/g.vue')
            },
            {
                path: '/h',
                name: 'h',
                component: () =>
                    import ('../views/classify/h.vue')
            },
        ]
    },
    {
        path: '/discount',
        name: 'discount',
        component: () =>
            import ('../views/discount.vue')
    },
    {
        path: '/cart',
        name: 'cart',
        component: () =>
            import ('../views/cart.vue')
    },
    {
        path: '/my',
        name: 'my',
        component: () =>
            import ('../views/my.vue')
    },
    {
        path: '/sign',
        name: 'sign',
        component: () =>
            import ('../views/sign.vue')
    },
    {
        path: '/serch',
        name: 'serch',
        component: () =>
            import ('../views/serch.vue')
    },
    {
        path: '/xiangqing',
        name: 'xiangqing',
        component: () =>
            import ('../views/xiangqing.vue')
    },
    {
        path: '/register',
        name: 'register',
        component: () =>
            import ('../views/register.vue')
    },
    {
        path: "/",
        redirect: "/skin"
    }

]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router